//
//  FormCollectionViewCell.m
//  Car
//
//  Created by 何晓文 on 15/9/22.
//  Copyright © 2015年 朱鸿儒. All rights reserved.
//

#import "FormCollectionViewCell.h"



#define kShowURL @"http://forum.app.autohome.com.cn/autov4.8.8/forum/club/topiccontent-a2-pm1-v4.8.9-t%@-o0-p1-s20-c1-nt0-fs0-sp0-al0-cw320-rct1.json"
@implementation FormCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {

	if (self = [super initWithFrame:frame]) {
		/**
		 倒影view
		 */
		self.reflectView = [[UIImageView alloc] initWithFrame:self.bounds];

		self.reflectView.image = [UIImage imageNamed:@"modelb"];
		[self.contentView addSubview:self.reflectView];
		
		self.picView = [[UIImageView alloc] initWithFrame:CGRectMake(self.width *0.05, self.height / 5, self.width *0.9, 180* 667 / 5 / 240)];
		self.picView.layer.borderWidth = 3;
		self.picView.layer.cornerRadius = 1;
		self.picView.layer.borderColor = [UIColor babyBlueColor].CGColor;
		[self.reflectView addSubview: self.picView];
		/**
			标题
		 */

		self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.width * 0.05, (self.picView.y + self.picView.height) + (self.height- (self.picView.y + self.picView.height)) / 2 -20, self.width * 0.9,self.picView.height * 0.4)];
		self.titleLabel.textColor = [UIColor blackColor];
		
		self.titleLabel.textAlignment = NSTextAlignmentCenter;
		self.titleLabel.numberOfLines = 0;
		self.titleLabel.font = [UIFont fontWithName:@"CourierNewPS-ItalicMT" size:8];
		[self.contentView   addSubview:self.titleLabel];
		self.layer.borderWidth = 2;
		self.layer.borderColor = [UIColor blackColor].CGColor;

		
	}
	return self;
}

- (void)setBeauty:(BeautyModel *)beauty {
	_beauty = beauty;
	[self.picView sd_setImageWithURL:[NSURL URLWithString:beauty.smallpic]];
	self.titleLabel.text = beauty.title;

}

@end
